const { defineConfig } = require("@vue/cli-service");
const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const { ElementPlusResolver } = require("unplugin-vue-components/resolvers");

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver({ importStyle: false })],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  },
  productionSourceMap:false,
  devServer: {
    proxy: {
      "/m.api": {
        // 代理api
        target: "http://192.168.1.188:8080", // 服务器api地址
        changeOrigin: true, // 是否跨域
      },
      "/upload/admin": {
        // 代理api
        target: "http://192.168.1.188:8080", // 服务器api地址
        changeOrigin: true, // 是否跨域
      },
    },
  }
});
